ContentReview Server Control

The ContentReview server control allows site visitors to rate and review content on your site. Place this control on a template page that’s used to display content items or eCommerce products. For example, you might place this control on a Master page and set it’s DynamicParameter property to ID. Then, when a Web form containing a content item or product passes its ID to the QueryString, the control can be used by a site visitor to record their rating and review.

The ContentReview server control can be used in two ways.

It places a star-based rating scale on any page of your Web site. Site visitors use the scale to rate a content item. Depending on the XSLT, they can also submit review comments.

It displays visitor reviews and comments. In this mode, the control can display reviews of a content item or reviews by a specific site or membership user. See Also: Displaying Content Reviews On the Site and Displaying a User’s Reviews On the Site.

Ektron CMS400.NET maintains and reports content reviews and ratings data. For more information, see Content Review.

Note: On a PageBuilder page, you can insert a ContentReview server control using the Calendar widget. See Also: Widget Reference

Note: The eCommerce Product List server control can also display the star-based rating scale. See Also: Set to true if you want the average ratings for this product to appear within the product display, as shown below. (Notice the stars below the price of the item.)

Displaying Content Reviews On the Site

To display content reviews on the site, follow these steps:

1. Drag and drop a ContentReview server control on a Web form.

2. Set the DefaultContentID property to the ID of the content for which reviews will be displayed.

Note: You can make the reviews for the content item dynamic by leaving DefaultContentID blank and setting DynamicParameter to ID.

3. Set the DisplayXSLT property to Review List.

Note: If you want to change the look and feel of the review list, modify an existing XSL file or create your own. If you modify an existing XSL, Ektron recommends saving the modified file with a different name. Then, enter the path to the file in the DisplayXSLT property.

4. Set the GetReviews property to Content.

5. Save the Web form.

Below is example of content reviews displayed on a Web page.

Displaying a User’s Reviews On the Site

To display reviews for a specific user on the site, follow these steps:

1. Drag and drop a ContentReview server control on a Web form.

2. Set the DisplayXSLT property to Review List.

Note: If you want to change the look and feel of the review list, modify an existing XSL file or create your own. If you modify an existing XSL, Ektron recommends saving the modified file with a different name. Then, enter the path to the file in the DisplayXSLT property.

3. Set the GetReviews property to User.

4. Set the UserID property to the ID of the user for which reviews will be displayed.

Note: You can make the list of reviews for a user dynamic by leaving the UserID blank and setting the DynamicParameter to ID.

5. Save the Web form.

Below is example of a user’s reviews displayed on a Web page.

Retrieving the XML Structure of a ContentReview

Retrieving the XML structure of XML content allows for greater control over developing XSLs. The following is an example of how to retrieve the XML structure:

1. Open a new Web form.

2. Drag and drop a ContentReview server control onto it.

3. Set the DefaultContentID property.

4. Drag and drop a Textbox on the Web form.

5. Set its TextMode property to MultiLine.

Note: Ektron recommends setting the width of the text box to at least 400px.

6. On the code behind page, add the following line.

Textbox1.Text = ContentReview.XmlDoc.InnerXml

7. Build the project.

8. View the Web form in a browser.

The XML structure of the collection appears in the textbox.

For an additional example, see the ContentReview XML page on the CMS400Developer samples page. It is located at:

In a browser:

http://<site root>/CMS400Developer/Developer/ContentList/ContentListXML.aspx

In the source code:

<site root>/CMS400Developer/Developer/ContentList/ContentListXML.aspx and ContentListXML.aspx.vb

ContentReview Server Control Properties

The following table explains the properties of the ContentReview server control.

Note: The following table only lists Ektron-specific properties. It does not describe native .NET properties such as font, height, width and border style. For documentation of these properties, see Visual Studio help.

Property

Value

Data Type

Authenticated

Indicates if you are logged in to the CMS Explorer and can use it to browse to Content, Collections, etc. See Also: Using CMS Explorer to Browse Your Ektron CMS400.NET Site

Boolean

DefaultContentID

The ID of a content block being rated by this server control.

If you don’t know the ID number of the content block, use the CMS Explorer to browse to it. See Also: Using CMS Explorer to Browse Your Ektron CMS400.NET Site

Long

 

DoInitFill

By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, FIll is automatically called during the Page Render event.

You might do this if you need to set or change a property on the control in codebehind and have it render with your changes shown.

Boolean

DisplayXslt

Select the type of review to display, or enter the path to a custom XSLT. For additional information, see Using the DisplayXSLT Property

Choices are:

Ajax 5 Stars - a five star rating system utilizing Ajax for display.

Ajax 5 Stars Comment - a five star rating system utilizing Ajax for display. In addition, when you hover over the stars, a review box pops-up below the stars. Comments that are added are submitted via an Ajax call.

Ajax 5 Stars with Increments - a five star rating system with half star increments that utilizes Ajax for display.

5 Stars - a five star rating system that allows visitors to add text reviews of content.

5 Stars with Increments - a five star rating system with half star increments that allows visitors to add text reviews of content.

Review List - displays a list of reviews for content or a user. See Also: Displaying Content Reviews On the Site and Displaying a User’s Reviews On the Site.

Path to Custom Xslt - enter the path to a custom XSLT.

Warning! If you specify an external file or modify an existing file, it is strongly recommended that you do not store this file in your site's Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.

String

DynamicParameter

To make this content review control dynamic, select id. When you do, this server control is attached to the content block passed as a URL parameter.

String

DynamicUserParameter

When using this control to retrieve a user’s reviews, set this property to UserId to make the user’s ID dynamic.

String

GetReviews

Returns a list of reviews for content or a user.

None - do not return reviews.

Content - returns reviews based on the content ID provided in the DefaultContentID property.

User - returns reviews based on the User ID provided in the UserId property.

ReviewTypes

Hide

Select False to display this server control on the page. Select True to suppress it.

Boolean

Language

Set a language for viewing content. This property shows results in design-time (in Visual Studio) and at run-time (in a browser).

Integer

MaxReviews

The number of reviews to retrieve if the GetReview property is set to Content or User. 0 (zero) = unlimited results.

See Also: GetReviews

Integer

Moderate

Setting this property to True allows CMS400.NET users to moderate reviews. See Also: Moderating Reviews

Boolean

RatingsMinimum

Sets a minimum number of reviews and ratings before displaying the average rating. When set to 0 (zero), the average rating is displayed as soon as content is rated the first time.

Integer

SuppressWrapperTags

Suppresses the output of the span/div tags around the control. The default is False.

True - Suppress wrap tags.

False - Allow wrap tags.

Boolean

UserID

The user ID for which to get reviews. If left blank, reviews from all users are returned. If a user ID is specified, only reviews for that user are returned.

Warning! The GetReviews property must be set to User for the control to use this property. See Also: GetReviews

Long

WrapTag

Allows a developer to specify a server control’s tag.

The default is Span.

Span - The <span> tag is used to designate an in-line portion of an HTML document as a span element.

Div - The <div> tag is used when you want to apply attributes to a block of code.

Custom - Lets you use custom tag.

String

Using the DisplayXSLT Property

The table below shows an example of each XSLT as it appears on a Web page, a description and the XSL file being used. The files are located in [Web Root]\[Site Root]\Workarea\Xslt.

Warning! If you want to edit an existing file, it is strongly recommended that you make a copy, change its name and move it outside of your site's Workarea folder. If you make changes to this file and do not move it out of the Workarea, this file and the changes will be lost when you upgrade. The files below are copies of files built, transformed and used, internally.

DisplayXSLT Selection

Description

File used

Ajax 5 Stars

A five-star rating system utilizing Ajax for display.

rating5star.xsl

 

Ajax 5 Stars Comment

A five-star rating system utilizing Ajax for display. When you hover over the stars, a review box pops-up. Visitor comments are submitted via an Ajax call.

rating5starComment.xsl

 

Ajax 5 Stars with Increments

A five-star rating system with half-star increments that uses Ajax for display.

rating5starinc.xsl

 

5 Stars

A five-star rating system that lets visitors add text reviews of content.

rating5starAddEdit.xsl

5 Stars with Increments

A five-star rating system with half star increments that allows visitors to add text reviews of content.

rating5starincAddEdit.xsl

Review List

Displays a list of reviews for content or a user.

See Also: Displaying Content Reviews On the Site and Displaying a User’s Reviews On the Site.

ratinglist.xsl
Previous TopicNext Topic|